import QtQuick
import QtQuick.Layouts
import QtCharts

Rectangle {
    Layout.fillWidth: true
    Layout.fillHeight: true

    ChartView {
        id: chartView
        title: "折线图示例"
        titleFont.bold: true
        titleFont.pointSize: 14

        anchors.fill: parent
        antialiasing: true

        LineSeries {
            name: "line"
            XYPoint { x: 0; y: 0 }
            XYPoint { x: 1; y: 3 }
            XYPoint { x: 2; y: 5 }
            XYPoint { x: 3; y: 3 }
            XYPoint { x: 4; y: 8 }
            XYPoint { x: 5; y: 10 }

            //只需要一组 x、y
            axisX: ValuesAxis {}
            axisY: ValuesAxis {}

            color: "#1296FF"
            capStyle: Qt.FlatCap  //Qt.SquareCap、Qt.RoundCap
            style: Qt.SolidLine
            width: 2
        }
    }
}
